// 公共接口
import { request } from "@/utils/http.js";

import globalConfig from "@/utils/config.js";

const baseUrl = globalConfig.microUrl;
const modules = "/mk";

export default {
  getCouponGoodsList: data => {
    return request({
      url: `${baseUrl}/market/coupon/getCouponGoodsList`,
      method: "GET",
      data,
    });
  },
  getReceivableCouponList: data => {
    return request({
      url: `${baseUrl}/market/coupon/getReceivableCouponList`,
      method: "GET",
      data,
    });
  },
  saveReceiveCoupon: data => {
    return request({
      url: `${baseUrl}/market/coupon/saveReceiveCoupon`,
      method: "POST",
      data,
    });
  },
  // 活动相关
  getActivityByStoreId: data => {
    return request({
      url: `${baseUrl}/market/activity/getActivityByStoreId`,
      method: "GET",
      data,
    });
  },
  // 优惠券相关
  couponPage: data => {
    return request({
      url: `${baseUrl}/market/coupon/page`,
      method: "GET",
      data,
    });
  },
  couponGetById: data => {
    return request({
      url: `${baseUrl}/market/coupon/getById`,
      method: "GET",
      data,
    });
  },
  findCountByStatus: data => {
    return request({
      url: `${baseUrl}/market/coupon/findCountByStatus`,
      method: "GET",
      data,
    });
  },

  // 集采活动
  groupPurchaseGet: data => {
    return request({
      url: `${baseUrl}/market/activityGroupPurchase/get`,
      method: "GET",
      data,
    });
  },
  groupPurchaseApplyCheck: data => {
    return request({
      url: `${baseUrl}/market/activityGroupPurchaseApply/checkActivityGroupPurchaseApply`,
      method: "GET",
      data,
    });
  },
  groupPurchaseApply: data => {
    return request({
      url: `${baseUrl}/market/activityGroupPurchaseApply/create`,
      method: "POST",
      data,
    });
  },
  getApplyStatus: data => {
    return request({
      url: `${baseUrl}/market/activityGroupPurchaseApply/getApplyStatus`,
      method: "GET",
      data,
    });
  },

  couponTemplateCenterPage: data => {
    return request({
      url: `${baseUrl}/${modules}/couponTemplate/centerPage`,
      method: "GET",
      data,
    });
  },

  // 邀请送好礼
  getGiftActivity: data => {
    return request({
      url: `${baseUrl}/market/activity/getGiftActivity`,
      method: "GET",
      data,
    });
  },

  // 活动集合页
  getActivityPage: data => {
    return request({
      url: `${baseUrl}/${modules}/activityPage/getActivityPage`,
      method: "GET",
      data,
    });
  },

  // 抽奖信息
  getLotteryInfo: data => {
    return request({
      url: `${baseUrl}/${modules}/lottery/getInfo`,
      method: "GET",
      data,
    });
  },

  // 抽奖
  drawLottery: data => {
    return request({
      url: `${baseUrl}/${modules}/lottery/draw`,
      method: "POST",
      data,
    });
  },
  // 获取落地页信息
  getBossLandingPageInfo: data => {
    return request({
      url: `${baseUrl}/${modules}/bossLandingPage/getBossLandingPageInfo`,
      method: "GET",
      data,
    });
  },
  // 获取落地页规则
  getBossLandingPageRule: data => {
    return request({
      url: `${baseUrl}/${modules}/bossLandingPage/getBossLandingPageRule`,
      method: "GET",
      data,
    });
  },
  // 获取徽章信息
  getMyBadge: data => {
    return request({
      url: `${baseUrl}/${modules}/activitySaleSum/getMyBadge`,
      method: "GET",
      data,
    });
  },
  // 超能Boos 创建我完成的任务记录
  lotteryTaskRecordCreated: data => {
    return request({
      url: `${baseUrl}/${modules}/lotteryTaskRecord/create`,
      method: "POST",
      data,
    });
  },
  // 超能Boos 中奖记录
  winRecordPage: data => {
    return request({
      url: `${baseUrl}/${modules}/lotteryDrawRecord/winRecordPage`,
      method: "GET",
      data,
    });
  },
  // 打卡信息
  getSignCardInfo: data => {
    return request({
      url: `${baseUrl}/${modules}/signCard/getInfo`,
      method: "GET",
      data,
    });
  },
  // 打卡
  signCard: data => {
    return request({
      url: `${baseUrl}/${modules}/signCard/sign`,
      method: "POST",
      data,
    });
  },
  // 创建任务
  createSignCardTaskRecord: data => {
    return request({
      url: `${baseUrl}/${modules}/signCardTaskRecord/create`,
      method: "POST",
      data,
    });
  },
  // 完成任务
  finishSignCardTaskRecord: data => {
    return request({
      url: `${baseUrl}/${modules}/signCardTaskRecord/finish`,
      method: "POST",
      data,
    });
  },
  // 打卡记录
  signCardRecordList: data => {
    return request({ url: `${baseUrl}${modules}/signCardRecord/list`, method: "GET", data });
  },
  // 任务记录
  signCardTaskRecordList: data => {
    return request({ url: `${baseUrl}${modules}/signCardTaskRecord/list`, method: "GET", data });
  },
  // 奖励记录
  signCardRewardRecordList: data => {
    return request({ url: `${baseUrl}${modules}/signCardRewardRecord/list`, method: "GET", data });
  },
  //
  getJXPurchaseActivity: data => {
    return request({
      url: `${baseUrl}/market/activity/getJXPurchaseActivity`,
      method: "GET",
      data,
    });
  },
};
